package com.uade.wcg.backend.DAO;

import java.util.List;

import javax.persistence.EntityManager;

import com.uade.wcg.backend.domain.Group;
import com.uade.wcg.backend.domain.Team;

public enum GroupDAO {
	INSTANCE;

	public void add(List<Team> teams, String name) {
	    synchronized (this) {
	      EntityManager em = EMFService.get().createEntityManager();
	      
	      Group group = new Group(teams, name);
	      em.persist(group);
	      em.close();

	    }
	 }
}
